#pragma once
#include "parser.h"
#include <map>
#include <string>
#include <sstream>


class Analyzer{
	
public:
	Analyzer();
	virtual ~Analyzer();

	virtual std::string analyze(Parser& p);

	// init the static arrays of the class
	static void setStaticArrays();


protected:

	static std::vector<std::string> types;
	static std::vector<std::string> keywords1;
	static std::vector<std::string> keywords2;
	static std::vector<std::string> operators;
	static std::vector<std::string> delimiters;
	

	// a boolean function that returns true iff the token's value is a predefined string in the language
	static bool isPredefined(const Token& t);

	// a boolean function that returns true iff the token's value is an identifier
	static bool isIdentifier(const Token& t);

	/*our blades*/
	virtual std::string bracesCheck(const Token& t);

	virtual std::string ifCheck(const Token& t);

	virtual std::string typeDclCheck(const Token& t);

	virtual std::string mainCheck(const Token& t);
	
	

	//assert - no minus value - if minus - zero &report
	//at the end - all = 0
	int curlyBraces; // { }
	int roundBraces; // ()
	int squareBraces; // []
	int ifcounter;
	bool typeFlag; // counts the "number" of types
	int mainCounter;
	std::string typeValDecl;
	std::map<std::string, std::string> symbolTable;
};

